#ifndef MCU_TYPES_H
#define MCU_TYPES_H

#include "Platform_Lib.h"
#include "Std_Types.h"
#include "Mcu_Cfg.h"

/*******************************************************************
| typedefs and structures (scope: module-local)
|------------------------------------------------------------------*/
	typedef unsigned long   Register_Type;
	/*****************Mcu_RawResetType*******************/
	typedef uint32 Mcu_RawResetType;

	/****************Mcu_ClockType**********************/
	typedef uint8 Mcu_ClockType;

	/***************Mcu_PllStatusType*******************/
	typedef enum
	{
		MCU_PLL_LOCKED = 0,
		MCU_PLL_UNLOCKED,
		MCU_PLL_STATUS_UNDEFINED
	}Mcu_PllStatusType;

	/****************Mcu_ResetType*********************/

	typedef enum
	{
		MCU_RESET_UNDEFINED,
		MCU_POWER_ON_RESET,
		MCU_ESR0_RESET,
		MCU_ESR1_RESET,
		MCU_WDT_RESET,
		MCU_SW_RESET,
		MCU_OCDS_RESET,
		MCU_CBS0_RESET,
		MCU_CBS1_RESET,
		MCU_CBS3_RESET,
		MCU_FLASH_TUNING_PROTECTION_RESET,
	}Mcu_ResetType;

	/*********************Mcu_Intrrupt Config********************/
	typedef void (*Mcu_IntRoutineType)(void);

	typedef struct
	{
		Register_Type Mcu_DisIntConfig;
		Mcu_IntRoutineType Mcu_IntRoutineArray[7];
	}Mcu_IntConfigType, *Mcu_IntConfigTypeRef;

	/*********************Mcu_ModeType***************************/

	typedef uint16 Mcu_ModeType;

#define		MCU_MODE_NORMAL 0
#define		MCU_MODE_IDLE   1
#define		MCU_MODE_SLEEP  2

	/*****************Mcu_DivConfigType*******************/
	typedef struct
	{
		uint8 K2div[8];
		uint8 K2steps;  //<=8; this parameter is not configured by user,
		                //     but generated by configuration environment
	}Mcu_DivConfigType, * Mcu_DivConfigTypeRef;

	/******************Mcu_ClockConfigType*****************/
	typedef struct
	{
		Register_Type Mcu_OSCCONConfig;
		Register_Type Mcu_PllCONConfig0;
		Register_Type Mcu_PllCONConfig1;
		Register_Type Mcu_CCUCONConfig0;
		Register_Type Mcu_CCUCONConfig1;
		Register_Type Mcu_EXTCONConfig;
		Register_Type Mcu_FDRConfig;

		Mcu_DivConfigTypeRef   McuDivConfigRef;

	}Mcu_ClockConfigType, *Mcu_ClockConfigTypeRef;


	/******************Mcu_ResetConfigType*****************/
#if (MCU_PERFORM_RESET_API == STD_ON)
	typedef struct
	{
		Register_Type Mcu_RSTCNTCONConfig;
		Register_Type Mcu_RSTCONConfig;
		Register_Type Mcu_ARSTDISConfig;
	}Mcu_ResetConfigType, *Mcu_ResetConfigTypeRef;
#endif

	/*********************Mcu_ConfigType************************/
	typedef struct
	{
		Mcu_ClockConfigTypeRef McuClockConfig;

		#if (MCU_PERFORM_RESET_API == STD_ON)
		Mcu_ResetConfigTypeRef McuResetConfig;
		#endif

		Register_Type		   McuTrapConfig;

		Mcu_IntConfigTypeRef   McuIntConfig;
	}Mcu_ConfigType, * Mcu_ConfigTypeRef;

#endif
